<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.view.*" %>
<%@ page import="com.conversationboard.config.*" %>
<%@ page import="java.security.*" %>
<%@ page import="java.util.Random" %>

<%
	Principal principal = request.getUserPrincipal();
	String loginId = principal.getName();
	
	Random generator = new Random();
	int randomNumber = generator.nextInt(100);
	
	User user = User.get(loginId);
	String displayName = user.getDisplayName();

	String[] words = user.getDisplayName().split(" ");

	String alternateDisplayName = words[0] + "" + randomNumber;
	
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	    <title>Chat</title>
		<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
	</head>
<body>

	<%= MainMenu.display(principal) %>

	<div class="headingblock">
		<h1>Chat</h1>
	</div>

	<div class="mainblock">

	<applet code=IRCApplet.class archive="irc.jar,pixx.jar" width=640 height=400>
	    <param name="CABINETS" value="irc.cab,securedirc.cab,pixx.cab">
	
	    <param name="nick" value="<%= displayName %>">
	    <param name="alternatenick" value="<%= alternateDisplayName %>">
	    <param name="name" value="Java User">
	    <param name="host" value="Diemen.NL.EU.Undernet.Org">
	    <param name="gui" value="pixx">
	
	    <param name="command1" value="join #conversationboard">
	</applet>

		
	</div>
	
	<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
	<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
	
</body>
</html>